Repository navigation
feat(id-native-shell): Bevy widget renderer for widget/1 surfaces (#12657 step 2c) - #13266
Merged
Merged
Conversation
…2657 step 2c) Pure WidgetModel over the host-validated WidgetSurface from step 1c: controls stacked one per row in document order, kind/label/action and toggle state carried through, accent color derived per kind family stepped by the control id's FNV-1a hash, and the focus order derived (actionable controls focusable, display-only skipped, wrap-around focus_step). WidgetRenderPlugin rebuilds one entity per control on view-sequence change with its prescribed ControlPlacement and keeps the Focused marker on the model's focus position. example_widgets is the harbor-controls document the step-1c contract tests project. Scope boundary, matching steps 2a/2b: the plugin owns presentation state only — input capture and delivering a focused control's named action to the world are later wiring steps over these same entities and the model's pure navigation functions. Verification (laptop route; the fleet-build container cannot run nix develop, the #13159-family gap): cargo nextest run -p id-native-shell 101 passed / 0 failed (91 baseline + 10 new); cargo fmt --check clean; clippy cap-lints run has no findings in the new module (the un-capped workspace run still stops on the pre-existing #13207 id-store sites, untouched).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 2c of #12657 — the Bevy widget renderer in
pkgs/id/crates/id-native-shell, following the two-layer shape steps 2a (PR #13214, scene) and 2b (PR #13244, audio) established. This is the last named slice of #12657: with it, all three rich surfaces accepted in step 1 (scene, audio, widget) have native-shell renderers.What lands
widget::WidgetModel— the pure presentation model: a validatedWidgetSurfacebecomes control models in document order, each stacked on its own row, carrying kind, label, action and toggle state from the contract, plus the derivations this renderer owns — an accent color (fixed hue family per kind, lightness stepped by the control id's FNV-1a hash, mirroringscene::node_color) and the focus order (controls that deliver an action are focusable, display-only controls are not; focus starts on the first focusable control;focus_stepis the pure wrap-around navigation rule).widget::WidgetRenderPlugin— reads the existingPresentedView(world input stays on the same contract frames): per view-sequence change it despawns the old view's control entities and spawns one entity per control with its prescribedControlPlacement; a chained system keeps theFocusedmarker on exactly the control the focus state names. Non-widget views clear the entities and focus state. Registered in the binary besideSceneRenderPluginandAudioRenderPlugin.widget::example_widgets— the deterministic example world's widget document: the harbor controls of the scene/audio examples (Start button, Lights toggle, Enter-the-harbor link), the same document the step-1c contract tests project.Scope boundary (stated in the module docs too): the plugin owns presentation state only. Capturing keyboard/pointer input, moving focus with it, and delivering a focused control's named action to the world are later wiring steps over these same entities and the model's pure navigation functions — the same boundary 2b drew at device playback.
Verification (laptop route; remote dispatch cannot run
nix develop— the #13159-family container gap):cargo nextest run -p id-native-shell101 passed / 0 failed (91 baseline + 10 new widget tests: determinism, stack order + state carriage, display-only focus skipping, wrap-around navigation incl. the no-focusable case, accent kind families,from_viewgating, entity spawn + placement fields, initialFocusedmarker, clear-on-non-widget, text-projection parity).cargo fmt --checkclean; clippy cap-lints run has no findings in the new module (the un-capped workspace run still stops earlier on the pre-existing id-storeexpect()sites tracked by id-store: admission.rs expect() on Mutex locks breaks the clippy gates on main (PR #13156) #13207, untouched).CI runs on main only per repo policy, so no PR checks apply.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-23T12:40:46Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": null, "model": null, "lane_start_issues": [], "workspace_ref": null, "auth_subject": "archer", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.